from selenium.webdriver.common.by import By

class SystemSettinglocator:
    #初始页面展开的tab
    default_page_expanded=(By.CSS_SELECTOR,'[aria-expanded="true"]')

    #system_setting_tab
    system_setting_tab = (By.XPATH, "//div[contains(@data-menu-id,'1-SETTING_DIR')]")

    #account_setting_tab
    account_setting_tab=(By.XPATH,"//div[contains(@data-menu-id,'ACCOUNT_SETTING_DIR')]")

    #custom_setting_tab
    custom_setting_tab=(By.CSS_SELECTOR,'[path="/console/theme_and_appearance"]')

    #basic_information_tab
    basic_information_tab=(By.CSS_SELECTOR,'[path="/console/basicInformation"]')

    #apperance_theme
    apperance_theme=(By.CSS_SELECTOR,'[class="customer-setting-sider"]>ul>:nth-child(1)')

    #admim_appearace
    admim_appearace_site=(By.XPATH,'(//span[@class="item-line-right-primaryOperation"])[2]')

    #color_site
    color_site=(By.XPATH,'(//span[@class="item-line-right-primaryOperation"])[3]')

    # user_appearace
    user_appearace_site=(By.XPATH,'(//span[@class="item-line-right-primaryOperation"])[1]')

    #public_confirm_button
    public_confirm_button=(By.CSS_SELECTOR,'[class="antd4-modal-footer"]>:nth-child(2)')

    #pot_theme
    pot_theme=(By.CSS_SELECTOR,'[class="cre-header theme-mixed"]')

    #system_exchange
    system_exchange=(By.CSS_SELECTOR,'[path="/console/theme_and_appearance/exchange"]')

    #exchange_edit
    exchange_edit=(By.XPATH,"//div[contains(@class,'exchange')]/div[1]/button")

    # exchange_view
    exchange_view=(By.XPATH,"//div[contains(@class,'exchange')]/div[2]/button")

    #exchange_rate_add
    exchange_rate_add=(By.CSS_SELECTOR,'[class="antd4-btn antd4-btn-default"]')

    #converted_currency_choice
    converted_currency_choice=(By.CSS_SELECTOR,'[class="antd4-select-selection-search"]')

    #converted_currency_option
    converted_currency_option=(By.CSS_SELECTOR,'[class="antd4-select-item-option-content"]')

    #current_value
    current_value=(By.CSS_SELECTOR,'[id="currentValue"]')

    #exchange_value
    exchange_value=(By.CSS_SELECTOR,'[id="exchangeValue"]')

    #confirm_button
    confirm_button=(By.CSS_SELECTOR,'[class="anticon anticon-check"]')

    #save_button
    save_button=(By.CSS_SELECTOR,'[class="antd4-btn antd4-btn-primary"]')

    #delete_button
    delete_button=(By.CSS_SELECTOR,'[aria-label="delete"]')

    #delete_ack
    delete_ack=(By.CSS_SELECTOR,'[class="antd4-checkbox"]')

    #exchange_rate_history
    exchange_rate_history=(By.XPATH,'(//div[@class="cre-table-nowrap"])[3]')

    #sub_button
    submit_button=(By.XPATH,"//div[contains(@class,'foot__')]/button[1]")

    #account_email
    account_email=(By.XPATH,"//div[contains(@class,'main___')]/div[1]//span[2]")

    #edit_button
    edit_button=(By.XPATH,"//div[contains(@class,'phoneNumber')]//button")

    #contact_deit_button
    contact_deit_button=(By.XPATH,"//div[contains(@class,'title')]//button")

    #verification_code
    verification_code=(By.CSS_SELECTOR,"[id='creForm_verificationCode']")

    #new_phone_number
    new_phone_number=(By.CSS_SELECTOR,'[id="creForm_phoneNumber"]')

    #new_verification_code
    new_verification_code=(By.CSS_SELECTOR,'[id=cn"creForm_verificationCode"]')

    #address_input
    address_input=(By.CSS_SELECTOR,'[id="address"]')

    #address_text
    address_text=(By.CSS_SELECTOR,'[class="antd4-descriptions-item-content"]')

    # authorization license菜单
    authorization_license_menu = (By.CSS_SELECTOR,'[path="/console/authorizationLicense"]')

    # authorization license界面basic information 字段
    authorization_version = (By.XPATH, '(//div[contains(@class,"cre-descriptions-nowrap")])[1]')
    authorization_company = (By.XPATH, '(//div[contains(@class,"cre-descriptions-nowrap")])[2]')
    authorization_type = (By.XPATH, '(//div[contains(@class,"cre-descriptions-nowrap")])[3]')
    authorization_name = (By.XPATH, '(//div[contains(@class,"cre-descriptions-nowrap")])[4]')
    authorization_created_at = (By.XPATH, '(//div[contains(@class,"cre-descriptions-nowrap")])[5]')

    # authorization license界面Licensing Details of Cloud Revenue Engine 字段
    name = (By.XPATH, '(//th[contains(@class,"antd4-table-cell")])[1]')
    software_content = (By.XPATH, '(//th[contains(@class,"antd4-table-cell")])[2]')
    unit = (By.XPATH, '(//th[contains(@class,"antd4-table-cell")])[3]')
    authorization_status = (By.XPATH, '(//th[contains(@class,"antd4-table-cell")])[4]')


    # custom setting页面Jump Link
    jump_link_tab = (By.CSS_SELECTOR, '[path="/console/theme_and_appearance/jumpLink"]')

    # custom setting页面zone
    zone_tab = (By.CSS_SELECTOR, '[path="/console/theme_and_appearance/zone"]')

    # documentation for admin编辑按钮
    documentation_for_admin_edit_button = (By.XPATH, '(//span[contains(@class,"anticon anticon-edit")])[7]')

    # documentation for personal user按钮
    documentation_for_personal_user_edit = (By.XPATH, '(//span[contains(@class,"anticon anticon-edit")])[3]')

    documentation_for_enterprise_user_edit = (By.XPATH, '(//span[contains(@class,"anticon anticon-edit")])[4]')

    # Top Bar Logo for User编辑按钮
    top_bar_logo_for_user_edit_button = (By.XPATH, '(//span[contains(@class,"anticon anticon-edit")])[2]')
    link_address = (By.ID, 'topBarLogoLink')

    # Cancel按钮
    cancel_button = (By.XPATH, '//span[text() = "Cancel"]')
    # Edit Documentation for Admin界面note
    documentation_note = (By.XPATH, '(//div[contains(@class,"ant-form-text")])[1]')
     # Edit Documentation for Admin界面note
    documentation_note2 = (By.XPATH, '(//div[contains(@class,"ant-form-text")])[2]')

    # zone界面列表字段
    sort = (By.XPATH, '(//th[contains(@class,"antd4-table-cell")])[1]')
    zone_id = (By.XPATH, '(//th[contains(@class,"antd4-table-cell")])[2]')
    zone_name = (By.XPATH, '(//th[contains(@class,"antd4-table-cell")])[3]')
    description = (By.XPATH, '(//th[contains(@class,"antd4-table-cell")])[4]')
    actions = (By.XPATH, '(//th[contains(@class,"antd4-table-cell")])[5]')



    # zone list列表Region选择框
    region_select = (By.XPATH, '(//div[contains(@class,"antd4-select-selector")])[1]')
    # zone list列表Region下拉第一个选择
    region_first_input = (By.XPATH, '(//div[contains(@class,"antd4-select-item-option-content")])[1]')
    # zone list列表zone id/name输入框
    zone_id_name_input = (By.ID, 'zone')
    # zone list列表搜索按钮
    zone_list_search_button = (By.XPATH, '(//span[contains(@class,"anticon anticon-search")])[1]')
    # zone list列表第一行id
    id_result = (By.XPATH, '(//span[contains(@class,"zoneId___1kJQc")])[1]')
    # zone list 列表第一行name
    name_result = (By.XPATH, '(//span[contains(@class,"zoneName___1IE88")])[1]')
    # zone list列edit按钮
    zone_list_edit_button = (By.XPATH, '//span[text() = "Edit"]')
    # edit界面zone name输入
    zone_name_input = (By.ID, 'displayName')
    # edit界面I acknowledge按钮
    I_acknoeledge_button = (By.XPATH, '(//span[contains(@class,"antd4-checkbox")])[1]')
    # edit界面OK按钮
    ok_button = (By.XPATH, '//span[text() = "OK"]')


    # Region 菜单
    region_tab = (By.CSS_SELECTOR, '[path="/console/theme_and_appearance/region"]')
    # region界面region id/name输入框
    region_id_name_input = (By.ID, 'value')
    # region 界面上搜索按钮
    region_list_search_button = (By.XPATH, '(//button[contains(@class,"antd4-btn antd4-btn-default antd4-btn-icon-only antd4-input-search-button")])[1]')
    # region界面列表字段
    region_id = (By.XPATH, '(//th[contains(@class,"antd4-table-cell")])[2]')
    region_name = (By.XPATH, '(//th[contains(@class,"antd4-table-cell")])[3]')
    billing_mode = (By.XPATH, '(//th[contains(@class,"antd4-table-cell")])[5]')
    support_price_modification = (By.XPATH, '(//th[contains(@class,"antd4-table-cell")])[6]')
    currency = (By.XPATH, '(//th[contains(@class,"antd4-table-cell")])[7]')

    # region界面列表第一行id
    id_first_result = (By.XPATH, '(//span[contains(@class,"regionId___3NlQb")])[1]')
    # region界面列表第一行name
    name_ffirst_result = (By.XPATH, '(//span[contains(@class,"regionName___2X2Yp")])[1]')

    #Initialization Settings页面
    initialization_settings_tab = (By.CSS_SELECTOR,'[path="/console/theme_and_appearance/initSettings"]')

    #Initialization Settings页面Reseller User Discount Level Setting编辑按钮
    level_setting_edit_buttton = (By.XPATH, '(//span[contains(@class,"anticon anticon-edit icon___2SfBH")])[5]')


    #Reseller User Discount Level Setting编辑界面add按钮
    add_button = (By.XPATH, '(//div[contains(@class,"antd4-space antd4-space-horizontal antd4-space-align-center add___AuIq8")])[1]')

    #Reseller User Discount Level Setting编辑界面删除按钮
    level_delete_button = (By.XPATH, '(//span[contains(@class,"anticon delete-icon___p-Sp1")])[6]')


    #Reseller User Discount Level Setting编辑界面Reseller lever输入框
    reseller_level_input = (By.ID, 'list_5_dictName')

    # Reseller User Discount Level Setting编辑界面discount range输入框
    discount_range_input = (By.ID, 'list_5_dictValue')


    # social media页
    social_media_tab = (By.CSS_SELECTOR, '[path="/console/theme_and_appearance/socialMedia"]')

    #social media界面craeete按钮
    social_media_create_button = (By.XPATH, '//span[text() = "Create"]')
    #social media创建界面类型选择框
    social_media_select = (By.XPATH, '(//div[contains(@class,"antd4-select-selector")])[2]')
    # 类型选择下拉第一个
    social_media_first_select = (By.XPATH, '(//div[contains(@class,"antd4-select-item antd4-select-item-option")])[1]')
    # url输入框
    url_input = (By.ID, 'socialMediaUrl')
    # social media列表新增记录url字段
    url_result = (By.XPATH, '(//div[contains(@class,"cre-table-nowrap")])[5]')
    # 新增记录的edit按钮
    social_media_edit_button = (By.XPATH, '(//a[text() = "Edit"])[5]')
    #新增记录的delete按钮
    social_media_delete_button = (By.XPATH, '(//a[text() = "Delete"])[5]')

    # Date&Time页面
    date_tab = (By.CSS_SELECTOR, '[path="/console/theme_and_appearance/dateTime"]')


